<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE HTML >
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>想法</title>

<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
<script type="text/javascript" src="js/jQuery.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<style type="text/css">
body {
	background-color: #3D71BC;
	background-image: url("img/pro-bg1.jpg");
	background-repeat: no-repeat;
}

.container {
	
	width:1005px;
}

.span3 {
	margin-top: 30px;
	height: 620px;
	margin-left: 0px;
	background-color: #fff;
	border-radius: 0px 160px 6px 0px;
	opacity: 0.3;
}

.span2 {
	margin-top: 110px;
	opacity: 0.7;
}

.span7 {
	
	margin-top: 110px;
	opacity: 0.7;
}

.flow {
	font-size: 22px;
	overflow: hidden;
	height: 140px;
	width: 300px;
}

.c-right {
	margin-right: auto;
}

li:hover {
	color: #fff;
}

.body-bgc {
	padding-top: 20px;
	width: 700px;
	background-color: #bod4e5;
	background: url("img/wash-white-30.png") repeat scroll 0 0 transparent;
}

.btn-fb {
	padding: 5px;
	margin: 15px;
	width: 65px;
	height: 45px;
	line-height: 45px;
	font-size: 20px;
	border-radius: 8px;
}

.title {
	height: 30px;
	width: 220px;
	background-image: url("img/title.png");
	background-repeat: no-repeat;
}

hr {
	margin: 5px 10px 10px 0;
}

.newproject {
	margin-bottom: 20px;
	margin-left: 25px;
}

.accordion-heading {
	height: 50px;
	background-color: #fff;
	opacity: 0.8;
}

.accordion-bottom {
	height: 30px;
	background-color: #fff;
	opacity: 0.8;
}

.contents {
	word-wrap: break-word;
	width: 600px;
	margin-left: 20px;
	font-size: 16px;
}

.collapse {
	background-color: #fff;
	opacity: 0.6;
}

.span9 {
	margin-left: 80px;
	margin-right: 20px;
	margin-top: 110px;
	opacity: 0.7;
}

.theidea {
	border-radius: 6px 6px 6px 6px;
	margin-left: 20px;
	margin-right: 20px;
}
</style>

</head>
<body>
	<%@ include file="include/topbar.jsp"%>

	<!--网页正文-->

	<div class="container ">
		<jsp:include page="include/left.jsp">
			<jsp:param value="new" name="tag" />
		</jsp:include><%-- 
		右侧--%>
		<div class="span7 body-bgc">
			<div>
				<div style="font-size: 30px; width:140px;margin-bottom: 5px">&nbsp;想法</div>

			</div>
			<div>
				<hr class="soften">
			</div>

			<div>
				<div class="theidea">
					<div class="accordion-heading">
						<h2>&nbsp;<c:out value="${idea.title}" escapeXml="true"></c:out></h2>
					</div>
					<div class="accordion-body collapse" id="#" style="height: 80px;">
						<div class="contents">
							<h3>&nbsp;<c:out value="${idea.content }" escapeXml="true"></c:out></h3>
						</div>
					</div>
					<div class="accordion-heading">
						<div style="float: right;margin-right: 10px">
							${idea.user.username}发表于${idea.outtime}</div>
					</div>
				</div>
				<div style="margin-top:10px;margin-left:30px">
					<form action="addideacomm.action?id=${idea.id}&user=${user}"
						method="post">
						<label>&nbsp;评论</label>
						<textarea rows="3" class="input-xlarge span6" cols=""
							name="ideacomment.content"></textarea>
					</form>
					
						<button type="submit" class="btn btn-success"
							style="margin-left:50px;" >
							<i class="icon-th-large icon-white"></i>发表
						</button>
				</div>



				&nbsp;回复
				<c:if test="${empty ideacommList }">
					<div class="alert alert-info">没人稀罕</div>


				</c:if>
				<c:forEach items="${ideacommList}" var="ideacomm">
					<div class="accordion-group"
						Style="margin-left: 20px;margin-right: 20px;">
						<div class="accordion-heading">
							<div style="height:5px"></div>
							<input type="hidden" name="ideacomm.id" value="${ideacomm.id }" />
							<div>
								<div style="margin-left:15px">
									<h4 Style="display:inline;">${ideacomm.user.username}&nbsp;:</h4>
									<span><c:out value="${ideacomm.content}" escapeXml="true"></c:out></span>
								</div>
							</div>
						</div>
						<div class="accordion-bottom">
							<a style="margin-left:20px;margin-right:20px" 
								class = "deletefile" rel="delideacomm.action?id=${ideacomm.id}&idea.id=${ideacomm.idea.id}"  href="javascript:void(0)"><i class="icon-trash"></i> </a>
							<div style="float: right;margin-right: 10px">
								——${ideacomm.outtime}</div>


						</div>
					</div>
				</c:forEach>

			</div>
		</div>
	</div>
	<div id="myModal4" class="modal fade">
		<a class="close" data-dismiss="modal">x</a>
		<div class="modal-header">
			<h2>删除记录</h2>
		</div>

		<div class="modal-body">
			<h3>确定删除？</h3>
		</div>

		<div class="modal-footer">
			<a id="entrydelete" class="btn btn-primary">删除</a> <a class="btn"
				data-dismiss="modal">取消</a>
		</div>

	</div>
<script type ="text/javascript">
		$(function() {
			var url;
			$(".deletefile").click(function() {
				$('#myModal4').modal('show');
				url = $(this).attr("rel");
			});

			$('#entrydelete').click(function() {
				$('#myModa4').modal('hide');
				window.location.href = url;
			});
			
			
			
			
			
			

		$("textarea").popover({
			title : "信息提示",
			content : "目标描述不能为空",
			trigger : "manual"
		});

		
		$("textarea").click(function() {
			$(this).popover("hide");
		});
		$("button").click(function() {
			

			if ($("textarea").val() == "") {
				$("textarea").popover("show");
				return false;
			}

			$("form").submit();

		});
			
			

		});
	</script>
</body>
</html>
